package com.liuf.druid.controller;

import com.liuf.druid.service.ITestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
/**
 * =====================================
 * @Description: 项目启动测试类
 * @Author: liuf
 * @Date: 2018-08-29 11:53
 * @码云： https://gitee.com/www.jiandan.com
 * =====================================
 */
@RestController
@RequestMapping(value = "/api/quartz")
public class QuartzController {

    private final Logger logger = LoggerFactory.getLogger(QuartzController.class);

    @Autowired
    private ITestService testServiceImpl;

    @GetMapping(value = "/{ID}")
    public String quartzTest(@PathVariable String ID){
        try{
            List<Map<String,Object>> testList = testServiceImpl.findTest();
            logger.debug("剩余任务数="+testList.size());
        }catch (Exception e){
            e.printStackTrace();
        }
        return "您好，您访问的调度器主键为="+ID;
    }
}
